$(function() {

    $(".shici td > a").click(function() {
        $shici = $(".shici");
        $last = $(this).parent('td');

        var name = $(this).text();
        var title = $last.siblings().first().text();

        var str = "ajax=" + "&name=" + name + "&title=" + title;
        console.log(str);
        jk_send_request_post("/shici/ListOne.html", str, responseAndSet);

        $("#shicicontent").find('.js-close').click(function() {
            clearContentDisplay($("#shicicontent"));
        });
    });

});

var overlay = "<div id='jk_overlay'></div>";

function responseAndSet(data, textStatus) {
    var result = dealSuccess(data, textStatus);
    if (result == true || result == false) return;

    $content = $("#shicicontent");
    $each = result.data;
    // $each.Name, $each.Title, $each.Content, $each.Author
    $content.find('header').html('<h4>' + $each.Name + '</h4>');
    $content.find('section').html('<textarea disabled>' + $each.Content + '</textarea>');

    $content.removeClass('no-display');
    $content.addClass('item-common');
    $content.addClass('jkcenter_absolute');

    $content.wrap(overlay);

    console.log(result.data.Name);

}

function clearContentDisplay(id) {
    id.find('header').html("");
    id.find('section').html("");
    id.addClass('no-display');
    id.removeClass('jkcenter_absolute');
    id.unwrap();
}